# create_time:  2021/5/3 17:09
from celery import Celery
import os

# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meiduo_mall.settings.dev_settings')
if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'meiduo_mall.settings.dev_settings'

# 创建celery实例
celery_app = Celery('meiduo')
# 加载celery配置
celery_app.config_from_object('celery_tasks.config')
# ⾃动注册celery任务
celery_app.autodiscover_tasks(['celery_tasks.sms', 'celery_tasks.email'])
